import Vue from 'vue'
import Router from 'vue-router'
import LoginRouter from './login.js'
//解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}


Vue.use(Router)

const router = new Router({
    mode: "history",
    routes: [{
            path: '/', //官网首页
            name: 'Home',
            component: () =>
                import ('@/components/home/home.vue'),
        }, {
            path: '/teamwork', //合作加盟
            name: 'TeamWork',
            component: () =>
                import ('@/components/teamwork/teamwork'),

        },
        {
            path: '/aboutUs', //关于我们
            name: 'AboutUs',
            component: () =>
                import ('@/components/about_us/about-us.vue'),

        },
        {
            path: '/helpCenter', //帮助中心
            name: 'HelpCenter',
            component: () =>
                import ('@/components/help_center/help-center.vue'),

        },
        {
            path: '/commonProblem', //帮助中心->常见问题
            name: 'CommonProblem',
            component: () =>
                import ('@/components/help_center/common_ problem/common- problem.vue'),
            children: [{
                path: 'aboutPrice', //帮助中心->常见问题->关于报价
                name: 'AboutPrice',
                component: () =>
                    import ('@/components/help_center/common_ problem/childer_page/about-price.vue'),

            }, {
                path: 'aboutPriceDetail', //帮助中心->常见问题->关于报价->账户使用详情内容
                name: 'AboutPriceDetail',
                component: () =>
                    import ('@/components/help_center/common_ problem/childer_page/about-price-detail.vue'),
            }, ]
        },
        {
            path: '/problemFeedback', //帮助中心->意见反馈
            name: 'ProblemFeedback',
            component: () =>
                import ('@/components/help_center/common_ problem/problem-feedback.vue'),

        },
        {
            path: '/newtextState', //首页->新闻动态
            name: 'NewtextState',
            component: () =>
                import ('@/components/home/middle/project-state/newtext-state.vue'),

        }, {
            path: '/newtextDetails', //首页->新闻动态->新闻详情
            name: 'NewtextDetails',
            component: () =>
                import ('@/components/home/middle/project-state/newtext-details.vue'),

        }, {
            path: '/informState', //首页->通知公告
            name: 'InformState',
            component: () =>
                import ('@/components/home/middle/project-state/inform-state.vue'),
        },
        {
            path: '/informDetails', //首页->通知公告->公告详情
            name: 'InformDetails',
            component: () =>
                import ('@/components/home/middle/project-state/inform-details.vue'),
        },
        ...LoginRouter

    ]
})
console.log('router', router)
export default router